package com.nwpu.coursesupport.view.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.nwpu.coursesupport.controller.AbstractController;
import com.nwpu.coursesupport.entity.bean.JSONResult;
import com.nwpu.coursesupport.enumeration.SubmitTaskStatus;
import com.nwpu.coursesupport.service.imple.LessonTaskMainDetailViewService;
import com.nwpu.coursesupport.view.criteria.LessonTaskMainDetailViewSearchCriteria;

@Controller
@RequestMapping("/lessonTaskMainDetail")
public class LessonTaskMainDetailViewController extends AbstractController{
		
	@RequestMapping("/detail")
	public String detail(@RequestParam("id")int id,HttpServletRequest request){
		JSONResult rst=invokeService("lessonTaskMainDetailView", "detail", "{\"assignId\":\"" + id + "\"}");
		request.setAttribute("data",this.parseData(rst));
		return "/teapage/classroomTaskSubmit";
	}
	
	@RequestMapping("/submitList")
	@ResponseBody
	public JSONResult submitList(String data){
		JSONResult rst=invokeService("lessonTaskMainDetailView", "submitList", data);
		return rst;
	}
}
